home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Franz PD / Franz PD Disk #279 (1993)(Rhein-Sieg-Soft).zip / Franz PD Disk #279 (1993)(Rhein-Sieg-Soft).adf / ak_gen0-lib_V38.20.LHA / ak_gen0-library / Programmers.LHA / Programmers / Examples / FileReq.c < prev    next >
C/C++ Source or Header  |  1993-06-26  |  2KB  |  50 lines

  1.  
  2.  /* FileReq V37.83                                             */
  3.  /* FREEWARE.                                                  */
  4.  /* (c) 1992-93 by Andreas R. Kleinert.                        */
  5.  /* Demonstrates use of the "ak_gen0.library"'s FileRequester. */
  6.  /* Also opening of windows is demonstrated.                   */
  7.  /* Written in SAS/C V6.00 for OS V2.04 (V37) Includes.        */
  8.  
  9. #include <ak_gen0/ak_gen0_pragma.h>
  10.  
  11. #include <stdlib.h>
  12.  
  13. #include <proto/exec.h>
  14. #include <proto/intuition.h>
  15.  
  16. void main(long argc, char **argv) /* MAIN */
  17. {
  18.  struct Window *tst_win = N;
  19.  char *fptr = N;
  20.  
  21.  IntuitionBase = (struct IntuitionBase *) OpenLibrary("intuition.library", 0);
  22.  
  23.   /* will always be open because of version==0 */
  24.  
  25.  printf("\nFileReq V37.83, FREEWARE, (c) 1992-93 by Andreas R. Kleinert.\n");
  26.  
  27.  AKBase = (struct AKBase *) OpenLibrary("ak_gen0.library", 37);
  28.  if(AKBase)
  29.   {
  30.    tst_win = AK_Window( 0, 0, 640, 256, 1, 2, N, (ACTIVATE|WINDOWSIZING|NOCAREREFRESH|SIMPLE_REFRESH), N, N, "Test-Window", N, N, 640, 256, 640, 256, WBENCHSCREEN);
  31.    if(tst_win)
  32.     {
  33.      fptr = AK_FileRequest(50, 20, CURRENT_SCREEN, tst_win, WBENCHSCREEN);
  34.  
  35.      if(fptr) FreeMem(fptr, AK_FILEREQ_STRING_LEN); /* free string returned by function */ 
  36.                                                     /* may be NULL (check out !)        */
  37.      CloseWindow(tst_win);
  38.     }
  39.  
  40.    CloseLibrary((APTR) AKBase);
  41.   }else
  42.   {
  43.    printf("\n Can't open \42ak_gen0.library\42 V37+ !\n");
  44.   }
  45.  
  46.  CloseLibrary((APTR) IntuitionBase);
  47.  
  48.  exit(0);
  49. }
  50.